<?php echo $this->render('/public/header'); ?>
<div id="main" class="row">
	<div class="col-lg-12 col-xs-12 col-sm-12 col-md-12">
		<ul class="nav nav-tabs">
		  <li role="presentation" <?php if ($type == 1): ?>class="active"<?php endif;?>><a href="?type=1">TOP10 Product Email</a></li>
		  <li role="presentation" <?php if ($type == 2): ?>class="active"<?php endif;?>><a href="?type=2">Register User</a></li>
		</ul>
		<div>
			<?php if ($type == 1): ?>
		<table class="table">
			<thead>
				<th>Date</th>
				<th>Email</th>
				<th>Ip</th>
				<th>Country</th>
			</thead>
			<tbody>
				<?php foreach ($list as $key => $value): ?>
					<tr>
						<td><?php echo date('Y-m-d H:i:s', $value['time']); ?></td>
						<td><?php echo $value['email']; ?></td>
						<td><?php echo $value['ip']; ?></td>
						<td><?php echo $value['city']; ?></td>
					</tr>
				<?php endforeach;?>
			</tbody>
		</table>
		<?php elseif ($type == 2): ?>
			<table class="table">
				<thead>
					<th>Date</th>
					<th>Name</th>
					<th>Email</th>
					<th>Send Inquiry</th>
				</thead>
				<tbody>
					<?php foreach ($list as $key => $value): ?>
						<tr>
							<td><?php echo $value['create_at']; ?></td>
							<td><?php echo $value['customer_name']; ?></td>
							<td><?php echo $value['email']; ?></td>
							<td>
								<?php if ($value['have_inquiry']): ?>
									<span class="label label-success">Yes</span>
								<?php else: ?>
									<span class="label label-default">Not</span>
								<?php endif;?>
							</td>
						</tr>
					<?php endforeach;?>
				</tbody>
			</table>

		<?php endif;?>
		<?php echo \yii\widgets\LinkPager::widget(['pagination' => $page]); ?>

		<div>
	</div>
</div>
<?php echo $this->render('/public/footer'); ?>